package com.example.room;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import java.util.List;

@Dao
public interface BookDao {

    @Insert
    void insert(BookInfo bookInfo);

    @Query(value = "select * from bookInfo")
    List<BookInfo> showList();
    @Query(value = "select * from bookInfo where bookName=:name")
    List<BookInfo> queryByName(String name);
    @Query(value = "select * from bookInfo where id = :id")
    BookInfo findById(Integer id);

    @Delete
    void delete(BookInfo bookInfo);

    @Update
    void update(BookInfo bookInfo);
}
